/*
*  Copyright 2019-2025 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.jiaoyou.moments.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
* @description /
* @author ztd
* @date 2025-11-18
**/
@Data
@TableName("moments")
public class Moments implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Integer id;

    @NotNull
    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @NotNull
    @ApiModelProperty(value = "用户昵称")
    @TableField(exist = false)
    private String nickName;

    @ApiModelProperty(value = "动态内容")
    private String content;

    @ApiModelProperty(value = "图片")
    private String images;

    @ApiModelProperty(value = "喜欢数")
    private Long likesCount;

    @ApiModelProperty(value = "创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间")
    private Date updatedAt;

    @ApiModelProperty(value = "评论数量")
    private Long commentsCount;

    @ApiModelProperty(value = "收藏数量")
    private Long collectCount;

    @ApiModelProperty(value = "分享数量")
    private Long shareCount;

    @ApiModelProperty(value = "类型")
    private String type;

    @ApiModelProperty(value = "发布地址")
    private String location;

    @ApiModelProperty(value = "视频")
    private String video;

    @ApiModelProperty(value = "城市")
    private String city;

    @ApiModelProperty(value = "省份")
    private String province;

    @ApiModelProperty(value = "未读")
    private BigDecimal latitude;

    @ApiModelProperty(value = "经度")
    private BigDecimal longitude;

    @ApiModelProperty(value = "是否推荐")
    private Integer isRecommended;

    @ApiModelProperty(value = "推荐原因")
    private String recommendReason;

    public void copy(Moments source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
